We are migrating the bug tracker to github Issues. This is now the preferred way to report NASM bugs.

Self-registration is disabled due to spam issue (mail gorcunov@gmail.com or hpa@zytor.com to create an account)

Bug 3392823 - OMF object output format silently ignores vstart= for sections
Summary: OMF object output format silently ignores vstart= for sections
Status: OPEN
Alias: None
Product: NASM
Classification: Unclassified
Component: Assembler (show other bugs)
Version: 2.16.xx
Hardware: All All
: MediumLow annoyance
Assignee: nobody
URL:
Depends on:
Blocks:
 
Reported: 2022-11-23 13:18 PST by E. C. Masloch
Modified: 2022-11-23 13:32 PST (History)
4 users (show)

Obtained from: Built from git using configure
Generated by: ---
Bug category:
Observed for: ---
Regression: ---
Regression since:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description E. C. Masloch 2022-11-23 13:18:00 PST
I recently ported some sources from TASM to NASM, allowing to assemble either with -f bin format or -f obj. I was surprised to find that -f obj accepted to specify sections with vstart= but that had no effect on the actual output. I understand that this is something the linker should implement rather than the assembler. I do think NASM should warn or error out on this however.

Reference: https://codeberg.org/boeckmann/ranish/issues/3#issuecomment-683832

In the NASM source, the OMF output format simply ignores unknown section attributes: https://github.com/netwide-assembler/nasm/blob/9939a2c00ec752100acbfaac01757f271f7d6040/output/outobj.c#L1512
Comment 1 H. Peter Anvin 2022-11-23 13:32:55 PST
You are, of course, correct. The parsing of directives in general quite frankly sucks; they are pretty much ad hoc everywhere which makes it hard to catch errors.

I'm always afraid of breaking existing code, for obvious reasons, and future backwards compatibility becomes an issue but the answer to both of these is pretty easy: this should be a warning, not an error.

That being said, this is obviously not 2.16 material, and probably not a huge priority for 2.17 since it after all doesn't affect code generation per se.

However, please do let me say that I'm super appreciative of all your testing help and very good bug reports. They have been invaluable for the 2.16 work.